/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package contatos.patterns.strategy;

import contatos.patterns.strategy.apoio.ComparadorDeOperadoraContato;
import java.util.ArrayList;
import java.util.Collections;

/**
 *
 * @author felipe
 */
public class OrdenarPorOperadora implements IOrdernarStrategy{

    @Override
    public void ordenar(ArrayList lista, boolean crescente) {
        Collections.sort(lista, new ComparadorDeOperadoraContato());
        if(!crescente)
            Collections.reverse(lista);
    }
    
}
